package com.lyf.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import com.sun.xml.internal.ws.api.PropertySet.Property;

@Entity
@Table(name="t_task")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Task {
	private String id;
	private String title;
	private String start;
	private String end;
	private boolean view;
	private boolean complete;
	private String createtime;
	private Tasktype tasktype;
	private Deal deal;
	private Contact contact;
	private User user;
	
	@Id
	@GenericGenerator(name="PK",strategy="uuid")
	@GeneratedValue(generator="PK")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	@Property(value="start")
	@Column(name="startdate")
	public String getStart() {
		return start;
	}
	public void setStart(String start) {
		this.start = start;
	}
	
	@Property(value="start")
	@Column(name="enddate")
	public String getEnd() {
		return end;
	}
	public void setEnd(String end) {
		this.end = end;
	}
	
	public boolean isView() {
		return view;
	}
	public void setView(boolean view) {
		this.view = view;
	}
	public boolean isComplete() {
		return complete;
	}
	public void setComplete(boolean complete) {
		this.complete = complete;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	
	@ManyToOne
	@JoinColumn(name="tasktypeid")
	public Tasktype getTasktype() {
		return tasktype;
	}
	public void setTasktype(Tasktype tasktype) {
		this.tasktype = tasktype;
	}
	
	@ManyToOne
	@JoinColumn(name="dealid")
	public Deal getDeal() {
		return deal;
	}
	public void setDeal(Deal deal) {
		this.deal = deal;
	}
	
	@ManyToOne
	@JoinColumn(name="contactid")
	public Contact getContact() {
		return contact;
	}
	public void setContact(Contact contact) {
		this.contact = contact;
	}
	
	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}